package com.xoa.controller.hr;

import com.xoa.model.common.HrCode;
import com.xoa.model.hr.HrStaffTitleEvaluation;
import com.xoa.service.hr.HrStaffTitleEvaluationService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 创建作者：戚中校
 * 模块信息：职位评定模块信息
 * @param
 * @param
 * @return
 */
@Controller
@RequestMapping("/hr/manage")
public class HrStaffTitleEvaluationController {
    @Autowired
    private HrStaffTitleEvaluationService hrStaTitEvaService;

    /**
     * 主页面
     * @return
     */
    @RequestMapping("/staff_title_evaluation")
    public String staffEvaluation(){
        return "app/hr/hrEvaluation/evaluationHomePage";
    }

    /**
     * 职位评定管理页面
     * @return
     */
    @RequestMapping("/evaluationManagement")
    public String staffEvaluationManagement(){
        return "app/hr/hrEvaluation/evaluationManagement";
    }

    /**
     * 新建职位评定信息页面
     * @return
     */
    @RequestMapping("/evaluationMessage")
    public String staffEvaluationMessage(){
        return "app/hr/hrEvaluation/evaluationMessage";
    }

    /**
     * 职位评定信息导入
     * @return
     */
    @RequestMapping("/evaluationInput")
    public String staffEvaluationInput(){
        return "app/hr/hrEvaluation/evaluationInput";
    }

    /**
     * 职位评定信息查询
     * @return
     */
    @RequestMapping("/evaluationQuery")
    public String staffEvaluationQuery(){
        return "app/hr/hrEvaluation/evaluationQuery";
    }


    /**
     * 职位评定信息详情
     * @return
     */
    @RequestMapping("/evaluationQueryDetail")
    public String staffEvaluationQueryDetail(){
        return "app/hr/hrEvaluation/evaluationQueryDetail";
    }



    /**
     * 创建者：戚中校
     * 方法介绍：分页查询所有的职位评定信息
     * @param page
     * @param pageSize
     * @param useFlag
     * @return
     */
    @RequestMapping("/queryAllEva")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> selectAll(Integer page, Integer pageSize, Boolean useFlag,String byEvaluStaffs){
        return hrStaTitEvaService.selectAll(page,pageSize,useFlag,byEvaluStaffs);
    }
    /**
     * 创建者：戚中校
     * 方法介绍：查询单个职位评定的详细信息
     * @return
     */
    @RequestMapping("/queryDetailEva")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> selectByPrimaryKey(Integer evaluationId){
        return hrStaTitEvaService.selectByPrimaryKey(evaluationId);
    }

    /**
     * 创建者：戚中校
     * 方法介绍：修改某条职位评定信息
     * @return
     */
    @RequestMapping("/updateEva")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> updateByPrimaryKeySelective(HttpServletRequest request,HrStaffTitleEvaluation record){
        return hrStaTitEvaService.updateByPrimaryKeySelective(request,record);
    }

    /**
     * 创建者：戚中校
     * 方法介绍：删除职位评定信息
     * @param evaluationIds
     * @return
     */
    @RequestMapping("/delAnyEva")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> deleteAnyEvaByPrimaryKeys(Integer[] evaluationIds){
        return hrStaTitEvaService.deleteAnyEvaByPrimaryKeys(evaluationIds);
    }

    /**
     * 创建者：戚中校
     * 方法介绍：添加职位评定信息
     * @param record
     * @return
     */
    @RequestMapping("/addEva")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> insertSelective(HttpServletRequest request,HrStaffTitleEvaluation record){
        return hrStaTitEvaService.insertSelective(request,record);
    }

    /**
     * 根据不同的条件查询相关的入职评定信息
     * @param record
     * @return
     */
    @RequestMapping("/queryEvaByCon")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> selectByCon(HttpServletRequest request, HttpServletResponse response, HrStaffTitleEvaluation record, Integer page, Integer pageSize, Boolean useFlag, String export,Integer[] deptId){
        return hrStaTitEvaService.selectByCon(request,response,record,page,pageSize,useFlag,export,deptId);
    }

    /**
     * 导入文件功能
     * @param
     * @return
     */
    @RequestMapping("/inputFile")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> importIncentiveInfo(HttpServletRequest request, HttpServletResponse response, MultipartFile file){
        return hrStaTitEvaService.importIncentiveInfo(request,response,file);
    }

    @RequestMapping("/getHrCodes1")
    @ResponseBody
    public  ToJson<HrCode> getHrCodes(String type) {
        return hrStaTitEvaService.getHrCodes(type);
    }



    @RequestMapping("/selNumByCon")
    @ResponseBody
    public ToJson<HrStaffTitleEvaluation> selectNumByCon(HrStaffTitleEvaluation record, Integer[] deptId){
        return  hrStaTitEvaService.selectNumByCon(record,deptId);
    }


}
